/* eslint-disable no-new */
var fs = require('fs');

exports.getContent = function(srcPath){
    var data = fs.readFileSync(srcPath+'.js', 'utf-8', function (err, bytesRead) {
        if (err) throw err;
    });
    data = data.substring(data.indexOf('default = Page') + 15);
    data = data.substring(0,data.length -2);
    // 取到data
    var dataObj = eval( "(" + data + ")" );

    return '        data () {' +
            '         return '+
            JSON.stringify(dataObj.data) +
            '   }';
}